/**
 * @Function 归集部门绩效统计DAO
 * @ProjectName credit-data-platform
 * @PackageName com.py.credit.dao
 * @FileName AchievementCountDao.java
 * @Date 2018年5月14日下午12:04:20
 * @Author Min DongXv
 * @Copyright (c) 2018, 金电联行 All Rights Reserved.
 */
package com.py.credit.dao;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;

import com.py.credit.entity.PromiseBookLog;
import com.py.credit.entity.PromiseBookReport;
import com.py.framework.core.common.Page;

/**
 * @Function 归集部门绩效统计DAO
 * @ClassName AchievementCountDao
 * @Date 2018年5月14日 下午12:04:20
 * @Author Min DongXv
 */
public interface PromiseBookReportDao {
	
	List<Map<String,Object>> getPromiseBooksByConditionForPage(
			@Param(value = "type")String type,
			@Param(value = "ztType")String ztType,
			@Param(value = "bookStatus")String bookStatus,
			@Param(value = "havBook")String havBook,
			@Param(value = "sql")String sql,
			@Param(value = "columns")List<String> columns, 
			@Param(value = "additionalColumns")String[] additionalColumns, 
			@Param(value = "conditions")List<String> conditions, 
			@Param(value = "page")Page page,
			@Param(value = "deptId")Long deptId,
			@Param(value = "userId")Long userId,
			@Param(value = "sbtype")String sbtype);
	
	
	int insertPromiseBook(
//			@Param(value = "name")String name,
			@Param(value = "type")String type,
			@Param(value = "ztName")String ztName,
//			@Param(value = "ztType")String ztType,
			@Param(value = "tyshxydm")String tyshxydm,
			@Param(value = "path")String path,
			@Param(value = "officeId")Long officeId,
			@Param(value = "officeName")String officeName);
	
	int updatePromiseBook(
			@Param(value = "name")String name,
			@Param(value = "id")Long id,
			@Param(value = "type")String type,
			@Param(value = "ztName")String ztName,
			@Param(value = "path")String path,
			@Param(value = "tyshxydm")String tyshxydm,
			@Param(value = "havBook")String havBook);
	
	int delPromiseBooks(@Param(value = "ids")List<Long> ids);
	
	int savePromiseBooks(@Param(value = "pbrList")List<PromiseBookReport> pbrList);

	String promiseBookPreview(@Param(value = "id")Long id);
	
	int approvalMyself(@Param(value = "idList")List<Long> idList);
	
	Map<String,Object> selectOne(@Param(value = "id")Long id);
	
	void insertErrorLog(@Param(value = "promiseBookLog")PromiseBookLog promiseBookLog);
	
	List<Map<String, Object>> selectAllLogsForPage(@Param(value = "page")Page page);
	
	String getDownloadLogPath(@Param(value = "id")String id);
	
	Map<String, String> selectCount(@Param(value = "id")Long id);
	
	String selectAllParentIds(@Param(value = "deptId")Long deptId);
}
